// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using System;
using System.Linq;
using Elastic.Clients.Elasticsearch.Serialization;

namespace Elastic.Clients.Elasticsearch.Eql;

public partial class EqlNamespacedClient : Elastic.Clients.Elasticsearch.NamespacedClientProxy
{
	/// <summary>
	/// <para>
	/// Initializes a new instance of the <see cref="Elastic.Clients.Elasticsearch.Eql.EqlNamespacedClient"/> class for mocking.
	/// </para>
	/// </summary>
	protected EqlNamespacedClient() : base()
	{
	}

	internal EqlNamespacedClient(Elastic.Clients.Elasticsearch.ElasticsearchClient client) : base(client)
	{
	}

	public virtual Elastic.Clients.Elasticsearch.Eql.EqlDeleteResponse Delete(Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequest request)
	{
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequest, Elastic.Clients.Elasticsearch.Eql.EqlDeleteResponse, Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.Eql.EqlDeleteResponse Delete(Elastic.Clients.Elasticsearch.Id id)
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequestDescriptor(id);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequest, Elastic.Clients.Elasticsearch.Eql.EqlDeleteResponse, Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.Eql.EqlDeleteResponse Delete(Elastic.Clients.Elasticsearch.Id id, System.Action<Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequestDescriptor> action)
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequestDescriptor(id);
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequest, Elastic.Clients.Elasticsearch.Eql.EqlDeleteResponse, Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequestParameters>(request);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.Eql.EqlDeleteResponse> DeleteAsync(Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequest request, System.Threading.CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequest, Elastic.Clients.Elasticsearch.Eql.EqlDeleteResponse, Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.Eql.EqlDeleteResponse> DeleteAsync(Elastic.Clients.Elasticsearch.Id id, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequestDescriptor(id);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequest, Elastic.Clients.Elasticsearch.Eql.EqlDeleteResponse, Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.Eql.EqlDeleteResponse> DeleteAsync(Elastic.Clients.Elasticsearch.Id id, System.Action<Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequestDescriptor> action, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequestDescriptor(id);
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequest, Elastic.Clients.Elasticsearch.Eql.EqlDeleteResponse, Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequestParameters>(request, cancellationToken);
	}

	public virtual Elastic.Clients.Elasticsearch.Eql.EqlGetResponse<TEvent> Get<TEvent>(Elastic.Clients.Elasticsearch.Eql.EqlGetRequest request)
	{
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.Eql.EqlGetRequest, Elastic.Clients.Elasticsearch.Eql.EqlGetResponse<TEvent>, Elastic.Clients.Elasticsearch.Eql.EqlGetRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.Eql.EqlGetResponse<TEvent> Get<TEvent>(Elastic.Clients.Elasticsearch.Id id)
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.EqlGetRequestDescriptor(id);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.Eql.EqlGetRequest, Elastic.Clients.Elasticsearch.Eql.EqlGetResponse<TEvent>, Elastic.Clients.Elasticsearch.Eql.EqlGetRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.Eql.EqlGetResponse<TEvent> Get<TEvent>(Elastic.Clients.Elasticsearch.Id id, System.Action<Elastic.Clients.Elasticsearch.Eql.EqlGetRequestDescriptor> action)
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.EqlGetRequestDescriptor(id);
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.Eql.EqlGetRequest, Elastic.Clients.Elasticsearch.Eql.EqlGetResponse<TEvent>, Elastic.Clients.Elasticsearch.Eql.EqlGetRequestParameters>(request);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.Eql.EqlGetResponse<TEvent>> GetAsync<TEvent>(Elastic.Clients.Elasticsearch.Eql.EqlGetRequest request, System.Threading.CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.Eql.EqlGetRequest, Elastic.Clients.Elasticsearch.Eql.EqlGetResponse<TEvent>, Elastic.Clients.Elasticsearch.Eql.EqlGetRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.Eql.EqlGetResponse<TEvent>> GetAsync<TEvent>(Elastic.Clients.Elasticsearch.Id id, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.EqlGetRequestDescriptor(id);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.Eql.EqlGetRequest, Elastic.Clients.Elasticsearch.Eql.EqlGetResponse<TEvent>, Elastic.Clients.Elasticsearch.Eql.EqlGetRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.Eql.EqlGetResponse<TEvent>> GetAsync<TEvent>(Elastic.Clients.Elasticsearch.Id id, System.Action<Elastic.Clients.Elasticsearch.Eql.EqlGetRequestDescriptor> action, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.EqlGetRequestDescriptor(id);
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.Eql.EqlGetRequest, Elastic.Clients.Elasticsearch.Eql.EqlGetResponse<TEvent>, Elastic.Clients.Elasticsearch.Eql.EqlGetRequestParameters>(request, cancellationToken);
	}

	public virtual Elastic.Clients.Elasticsearch.Eql.GetEqlStatusResponse GetStatus(Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequest request)
	{
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequest, Elastic.Clients.Elasticsearch.Eql.GetEqlStatusResponse, Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.Eql.GetEqlStatusResponse GetStatus(Elastic.Clients.Elasticsearch.Id id)
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequestDescriptor(id);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequest, Elastic.Clients.Elasticsearch.Eql.GetEqlStatusResponse, Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.Eql.GetEqlStatusResponse GetStatus(Elastic.Clients.Elasticsearch.Id id, System.Action<Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequestDescriptor> action)
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequestDescriptor(id);
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequest, Elastic.Clients.Elasticsearch.Eql.GetEqlStatusResponse, Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequestParameters>(request);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.Eql.GetEqlStatusResponse> GetStatusAsync(Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequest request, System.Threading.CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequest, Elastic.Clients.Elasticsearch.Eql.GetEqlStatusResponse, Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.Eql.GetEqlStatusResponse> GetStatusAsync(Elastic.Clients.Elasticsearch.Id id, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequestDescriptor(id);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequest, Elastic.Clients.Elasticsearch.Eql.GetEqlStatusResponse, Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.Eql.GetEqlStatusResponse> GetStatusAsync(Elastic.Clients.Elasticsearch.Id id, System.Action<Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequestDescriptor> action, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequestDescriptor(id);
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequest, Elastic.Clients.Elasticsearch.Eql.GetEqlStatusResponse, Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequestParameters>(request, cancellationToken);
	}

	public virtual Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent> Search<TEvent>(Elastic.Clients.Elasticsearch.Eql.EqlSearchRequest request)
	{
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.Eql.EqlSearchRequest, Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent>, Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent> Search<TDocument, TEvent>()
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestDescriptor<TDocument>();
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.Eql.EqlSearchRequest, Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent>, Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent> Search<TDocument, TEvent>(System.Action<Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestDescriptor<TDocument>> action)
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestDescriptor<TDocument>();
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.Eql.EqlSearchRequest, Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent>, Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent> Search<TDocument, TEvent>(Elastic.Clients.Elasticsearch.Indices indices)
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestDescriptor<TDocument>(indices);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.Eql.EqlSearchRequest, Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent>, Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent> Search<TDocument, TEvent>(Elastic.Clients.Elasticsearch.Indices indices, System.Action<Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestDescriptor<TDocument>> action)
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestDescriptor<TDocument>(indices);
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.Eql.EqlSearchRequest, Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent>, Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestParameters>(request);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent>> SearchAsync<TEvent>(Elastic.Clients.Elasticsearch.Eql.EqlSearchRequest request, System.Threading.CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.Eql.EqlSearchRequest, Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent>, Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent>> SearchAsync<TDocument, TEvent>(System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestDescriptor<TDocument>();
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.Eql.EqlSearchRequest, Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent>, Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent>> SearchAsync<TDocument, TEvent>(System.Action<Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestDescriptor<TDocument>> action, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestDescriptor<TDocument>();
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.Eql.EqlSearchRequest, Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent>, Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent>> SearchAsync<TDocument, TEvent>(Elastic.Clients.Elasticsearch.Indices indices, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestDescriptor<TDocument>(indices);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.Eql.EqlSearchRequest, Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent>, Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent>> SearchAsync<TDocument, TEvent>(Elastic.Clients.Elasticsearch.Indices indices, System.Action<Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestDescriptor<TDocument>> action, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestDescriptor<TDocument>(indices);
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.Eql.EqlSearchRequest, Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse<TEvent>, Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestParameters>(request, cancellationToken);
	}
}